Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MINOR: clarify message ordering with max in-flight requests and idempotent producer #10690

Conversation

ableegoldman
Copy link
Member

@ableegoldman ableegoldman commented May 14, 2021

The docs for the max.in.flight.requests.per.connection and enable.idempotence configs currently imply that setting the max in-flight request greater than 1 will break the message ordering guarantee, but that is only true if enable.idempotence is false. When using an idempotent producer, the max in-flight request can be up to 5 without re-ordering messages.

See this discussion

@ableegoldman ableegoldman requested a review from ijuma May 14, 2021 01:17
+ "are not explicitly set by the user, suitable values will be chosen. If incompatible values are set, "
+ "a <code>ConfigException</code> will be thrown.";
+ "a <code>ConfigException</code> will be thrown. With an idempotent producer, setting the <code>" + MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION
+ "</code> greater than 1 will not break ordering guarantees.";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: max-in-flight cannot be larger than 5 if idempotent producer is enabled.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That requirement is covered a few sentences before this one, it might be cut off by Github. I think it's clear that by "greater than 1", we just mean "between 1 and 5, the maximum allowable limit as stated above"

Copy link
Contributor

@ijuma ijuma May 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of an additional sentence at the end, could we modify the first sentence to also mention ordering?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will do

@ableegoldman
Copy link
Member Author

Wow, all checks actually passed! That's the second completely green build I've seen in 24 hours, must be my lucky day 😄

@@ -201,7 +201,8 @@
public static final String MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION = "max.in.flight.requests.per.connection";
private static final String MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION_DOC = "The maximum number of unacknowledged requests the client will send on a single connection before blocking."
+ " Note that if this setting is set to be greater than 1 and there are failed sends, there is a risk of"
+ " message re-ordering due to retries (i.e., if retries are enabled).";
+ " message re-ordering due to retries (i.e., if retries are enabled). With an idempotent producer, this"
+ " can be up to 5 and still provide ordering guarantees.";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The enable.idempotence will be true by default in 3.0, so we should perhaps have the "up to 5" thing first.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ijuma done

@ableegoldman
Copy link
Member Author

Just the one flaky test org.apache.kafka.streams.integration.KTableKTableForeignKeyInnerJoinMultiIntegrationTest.shouldInnerJoinMultiPartitionQueryable() which Luke is going to look into. This should be ready to merge if there are no further suggestions @ijuma @mjsax

@mjsax
Copy link
Member

mjsax commented May 22, 2021

From my side: ship it.

@ableegoldman
Copy link
Member Author

ableegoldman commented May 24, 2021

Some unrelated test failures in RaftClusterTest, connect.integration.RebalanceSourceConnectorsIntegrationTest.testDeleteConnector(), and
kafka.api.PlaintextConsumerTest.testPartitionsFor()

Will merge to trunk

@ableegoldman ableegoldman merged commit 33df5c6 into apache:trunk May 24, 2021
ijuma added a commit to ijuma/kafka that referenced this pull request May 26, 2021
…e-allocations-lz4

* apache-github/trunk: (43 commits)
  KAFKA-12800: Configure generator to fail on trailing JSON tokens (apache#10717)
  MINOR: clarify message ordering with max in-flight requests and idempotent producer (apache#10690)
  MINOR: Add log identifier/prefix printing in Log layer static functions (apache#10742)
  MINOR: update java doc for deprecated methods (apache#10722)
  MINOR: Fix deprecation warnings in SlidingWindowedCogroupedKStreamImplTest (apache#10703)
  KAFKA-12499: add transaction timeout verification (apache#10482)
  KAFKA-12620 Allocate producer ids on the controller (apache#10504)
  MINOR: Kafka Streams code samples formating unification (apache#10651)
  KAFKA-12808: Remove Deprecated Methods under StreamsMetrics (apache#10724)
  KAFKA-12522: Cast SMT should allow null value records to pass through (apache#10375)
  KAFKA-12820: Upgrade maven-artifact dependency to resolve CVE-2021-26291
  HOTFIX: fix checkstyle issue in KAFKA-12697
  KAFKA-12697: Add OfflinePartitionCount and PreferredReplicaImbalanceCount metrics to Quorum Controller (apache#10572)
  KAFKA-12342: Remove MetaLogShim and use RaftClient directly (apache#10705)
  KAFKA-12779: KIP-740, Clean up public API in TaskId and fix TaskMetadata#taskId() (apache#10735)
  KAFKA-12814: Remove Deprecated Method StreamsConfig getConsumerConfigs (apache#10737)
  MINOR: Eliminate redundant functions in LogTest suite (apache#10732)
  MINOR: Remove unused maxProducerIdExpirationMs parameter in Log constructor (apache#10723)
  MINOR: Updating files with release 2.7.1 (apache#10660)
  KAFKA-12809: Remove deprecated methods of Stores factory (apache#10729)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants